﻿using System;
using Microsoft.ServiceBus.Notifications;

namespace SendPushNotification
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            SendNotificationAsync();
            Console.ReadLine();
        }

        private static async void SendNotificationAsync()
        {
            NotificationHubClient hub =
                NotificationHubClient.CreateClientFromConnectionString(
                    "Endpoint=sb://mva-pushnotificationdemo-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=EBdSc+LG8QmgyNmV6OJlGSHYQjvt9OpuFnnoQqKQV0c=",
                    "mva-pushnotificationdemo");
            string toast =
                @"<toast><visual><binding template=""ToastText01""><text id=""1"">Push from Console, via Azure, to Windows Store App!</text></binding></visual></toast>";
            await hub.SendWindowsNativeNotificationAsync(toast);
        }
    }
}